#ifndef __INTERACT_H__
#define __INTERACT_H__

#include"client.h"

#define ARGS_NUM 5
#define NETCONF_FILENAME "./conf/net.conf"
#define TRANS_NETCONF_FILENAME "./conf/transNet.conf"
#define ARGS_LENGTH 64
#define PWD_LENGTH 512




#define USER_NAME_LENGTH 64


typedef struct {
    char name[USER_NAME_LENGTH];
    char pwd[PWD_LENGTH];
    int soecktFd;
} userStat_t, *puserStat;

typedef struct{
    int dataLen;//存储的是 buf上到底运了多少数据
    char buf[1000];//存储要发送的数据
}train_t;


int read_config(const char *filename,char args[][ARGS_LENGTH],int argNum);
int get_args(char args[][64],int *pargc);
int shell(puserStat);



enum command_e
{
    CMD_PWD = 0,
    CMD_LS,
    CMD_CD,
    CMD_PUTS,
    CMD_GETS,

    CMD_TYPES
};
#define CMD_LENGTH 6

typedef struct
{
    char command[CMD_LENGTH];
    void (*func)(int argc, char args[][ARGS_LENGTH],puserStat);
} command_t;

void cmd_pwd(int argc, char args[][ARGS_LENGTH],puserStat);

void cmd_ls(int argc, char args[][ARGS_LENGTH],puserStat);

void cmd_cd(int argc, char args[][ARGS_LENGTH],puserStat);

void cmd_puts(int argc, char args[][ARGS_LENGTH],puserStat);

void cmd_gets(int argc, char args[][ARGS_LENGTH],puserStat);

#endif